<div class="editor-row">
    <div class="section gf-form-group" ng-repeat="yaxis in ctrl.panel.yAxis">

        <h5 class="section-heading" ng-show="$index === 0">左 Y 轴</h5>
        <h5 class="section-heading" ng-show="$index === 1">右 Y 轴</h5>

        <gf-form-switch class="gf-form" label="显示" label-class="width-6" checked="yaxis.show" on-change="ctrl.refreshPanel()"></gf-form-switch>

        <div ng-if="yaxis.show">
            <div class="gf-form">
                <label class="gf-form-label width-6">单位</label>
                <div class="gf-form-dropdown-typeahead max-width-20" ng-model="yaxis.format" dropdown-typeahead2="ctrl.unitFormats" dropdown-typeahead-on-select="ctrl.setUnitFormat(yaxis, $subItem)"></div>
            </div>
        </div>

        <div class="gf-form">
            <label class="gf-form-label width-6">坐标轴类型</label>
            <div class="gf-form-select-wrapper max-width-20">
                <select class="gf-form-input" ng-model="yaxis.type" ng-options="k as v for (k, v) in ctrl.yAxisType" ng-change="ctrl.refreshPanel()"></select>
            </div>
        </div>

        <div class="gf-form" ng-if="yaxis.type === 'log'">
            <label class="gf-form-label width-6">缩放</label>
            <div class="gf-form-select-wrapper max-width-20">
                <select class="gf-form-input" ng-model="yaxis.logBase" ng-options="v as k for (k, v) in ctrl.logScales" ng-change="ctrl.refreshPanel()"></select>
            </div>
        </div>

        <div class="gf-form-inline">
            <div class="gf-form">
                <label class="gf-form-label width-6">Y 轴最小值</label>
                <input type="text" class="gf-form-input width-5" placeholder="自动" empty-to-null ng-model="yaxis.min" ng-change="ctrl.refreshPanel()" ng-model-onblur>
            </div>
            <div class="gf-form">
                <label class="gf-form-label width-6">Y 轴最大值</label>
                <input type="text" class="gf-form-input width-5" placeholder="自动" empty-to-null ng-model="yaxis.max" ng-change="ctrl.refreshPanel()" ng-model-onblur>
            </div>
        </div>

        <div ng-if="yaxis.show">
            <div class="gf-form">
                <label class="gf-form-label width-6">小数点</label>
                <input type="number" class="gf-form-input max-width-20" placeholder="自动" empty-to-null bs-tooltip="'覆盖 Y 轴的自动小数精度'" data-placement="right" ng-model="yaxis.decimals" ng-change="ctrl.refreshPanel()" ng-model-onblur>
            </div>

            <div class="gf-form">
                <label class="gf-form-label width-6">标签</label>
                <input type="text" class="gf-form-input max-width-20" ng-model="yaxis.name" ng-change="ctrl.refreshPanel()" ng-model-onblur>
            </div>
        </div>
    </div>

    <div class="section gf-form-group">
        <h5 class="section-heading">X 轴</h5>
        <gf-form-switch class="gf-form" label="显示" label-class="width-6" checked="ctrl.panel.xAxis.show" on-change="ctrl.refreshPanel()"></gf-form-switch>

        <gf-form-switch class="gf-form" label="换行" label-class="width-6" checked="ctrl.panel.xAxis.lineBreak" on-change="ctrl.setXAxisLabel()"></gf-form-switch>

        <div class="gf-form" ng-show="ctrl.panel.xAxis.lineBreak">
            <label class="gf-form-label width-6">
                每行字符数
            </label>
            <input type="number" class="gf-form-input width-5" placeholder="0" ng-model="ctrl.panel.xAxis.lineNumber" ng-change="ctrl.setXAxisLabel()" ng-model-onblur data-placement="right">
        </div>

    </div>

</div>
